%include "nasm_macros.inc"
%include "os.inc"
section .text
BITS 16
%define SEGLDR 2000h
%define OFFLDR 0
%define VIDEOSEG 0b800h
org OFFLDR
;org 100h
go:
;******************* CODE *******************;
push cs
pop ds
push cs
pop es
mov ax,msg1
call print
cli
jmp $
;******************* PROCS *******************;

;ds:ax=msg
print:
pushad
push es
push VIDEOSEG
pop es
call .nx
dw 0
.nx:
pop di
mov di,[cs:di]
mov si,ax
.bk:
lodsb
or al,al
je .je
stosb
mov al,7
stosb
jmp .bk
.je:
pop es
popad
ret


;******************* DATA *******************;
msg1 db 'Switching to PM...',0
GDTR osGDTR
IDTR osIDTR
;%include "procs.asm"